package li.nibble.twittertido;

import li.nibble.twittertido.model.DataBase;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Tutorial_12 extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tutorial_12);
		Button back = (Button) findViewById(R.id.back);
		Button next = (Button) findViewById(R.id.next);

		back.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				back();
			}
		});

		next.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {

				if (!DataBase.registered(Tutorial_12.this)) {
					startActivity(new Intent(Tutorial_12.this, Login.class)
							.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
				} else {
					startActivity(new Intent(getApplicationContext(),
							Main.class)
							.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
				}

			}
		});
	}

	public void back() {
		super.onBackPressed();
	}

}